package com.bestcem.xm.om.service.email;

import com.bestcem.xm.om.entity.EmailBox;
import org.springframework.mail.javamail.JavaMailSenderImpl;

/**
 * 邮件发送对象池
 *
 * @author zhangfeng <feng.zhang@idiaoyan.com>
 * @version v1.0
 * @date 2021/12/1 16:24
 */
public interface JavaEmailSenderPool {

    /**
     * 获取邮箱发送服务类
     *
     * @param email
     * @return org.springframework.mail.javamail.JavaMailSenderImpl
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2021/12/1 16:57
     */
    JavaMailSenderImpl getSender(String email);

    /**
     * 获取默认的官方邮箱发送服务类
     *
     * @return org.springframework.mail.javamail.JavaMailSenderImpl
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/1/5 11:57
     */
    JavaMailSenderImpl getDefaultSender();

    /**
     * 邮箱相关信息修改时，更新发件人对象
     *
     * @param emailBox
     * @return void
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2021/12/10 11:37
     */
    void reloadSender(EmailBox emailBox);
}
